package com.bbs.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.bbs.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

@Controller
@Scope(value = "prototype")
@SuppressWarnings("serial")
public class LoginUserAction extends ActionSupport {
	private String userName;
	private String password;
	private UserService userService;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserService getUserService() {
		return userService;
	}

	@Resource(name = "userServiceImpl")
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String execute() {
		userService.loginUser(userName, password);
		return SUCCESS;
	}
}
